home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_02_03
/
2n03023c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1991-01-09
|
307 b
|
18 lines
/*
* An implementation of the Standard C library function memcmp.
*/
int memcmp(const void *s1, const void *s2, size_t n)
{
const unsigned char *t1 = s1;
const unsigned char *t2 = s2;
size_t i;
for (i = 0; i < n; ++i)
if (t1[i] != t2[i])
return t1[i] - t2[i];
return 0;
}